package com.retoc.graduationtravel.domain.req;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Date;

/**
 * @TableName user
 */
@TableName(value = "user")
@Data
public class UserSaveReq implements Serializable {

//    private Long id;

    /**
     * 账号
     */
    @NotNull(message = "用户名不能为空")
    private String userName;

    /**
     * 昵称
     */
    @NotNull(message = "昵称不能为空")
    private String name;

    /**
     * 密码
     */
    @NotNull(message = "密码不能为空")
    @Pattern(regexp = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,32}$", message = "密码至少包含数字和英文，长度6-32位")
    private String password;

    /**
     * 头像照片
     */
    private String photo;

    /**
     * 注册日期
     */
    private Date registerTime;

    private Integer sex;
    private Date birthday;
    private String introduction;
    private String email;
    private Integer age;
    private String website;


    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}